package com.itspeedster.betterforeyes;

import java.awt.Image;
import java.awt.image.BufferedImage;
import java.io.IOException;

import javax.imageio.ImageIO;

public class AppRessources {
	
	public static Image icon;
	
	public static Image getAppIcon(){
		if (icon == null){
			icon = getImage("icon.png");
		}
		return icon;
	}
	
	public static Image getImage(String name){
		try{
			BufferedImage image = ImageIO.read(Object.class.getResourceAsStream("/images/" + name));
			return image;
		}catch (IOException ex){
			System.out.println("Better for eyes: cannot load icon " + name);
		}
		return new BufferedImage(32, 32, BufferedImage.TYPE_INT_RGB);
	}
}
